package com.example.dynamicschedule.service.impl;

import com.example.dynamicschedule.bean.CkStopNoticePerson;
import com.example.dynamicschedule.dao.CkStopNoticePersonMapper;
import com.example.dynamicschedule.service.CkStopNoticePersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;

@Service
public class CkStopNoticePersonServiceImpl implements CkStopNoticePersonService {
    @Autowired
    private CkStopNoticePersonMapper ckStopNoticePersonMapper;

    @Override
    public List<CkStopNoticePerson> selectList() {

        return ckStopNoticePersonMapper.selectList(new HashMap<>());
    }

    @Override
    public List<CkStopNoticePerson> selectByType(byte type) {
        return ckStopNoticePersonMapper.selectByType(type);

    }
    @Override
    public List<CkStopNoticePerson> findOutOfContactAll() {
        return   ckStopNoticePersonMapper.findOutOfContactAll();

    }

    @Override
    public void updateForeach(List<CkStopNoticePerson> contactCkStopNoticePeople) {
        ckStopNoticePersonMapper.updateForeach(contactCkStopNoticePeople);
    }

    @Override
    public List<String> findOutOfContactBySerialNumber(Set<String> serialNumbers) {
        List<String> serialNumberList = new ArrayList<>();
        serialNumbers.stream().forEach(s -> serialNumberList.add(s));
        return ckStopNoticePersonMapper.findOutOfContactBySerialNumber(serialNumberList);
    }

    @Override
    public void insertForeach(List<CkStopNoticePerson> ckStopNoticePeople2) {
        ckStopNoticePersonMapper.insertForeach(ckStopNoticePeople2);
    }

    @Override
    public void updateForeachBySeriaNumber(List<CkStopNoticePerson> threes) {

        ckStopNoticePersonMapper.updateForeachBySeriaNumber(threes);
    }
}
